package com.atguigu.admin.controller;

import com.atguigu.admin.model.entity.SysLoginLog;
import com.atguigu.admin.model.vo.SysLoginLogQueryVo;
import com.atguigu.admin.service.SysLoginLogService;
import com.atguigu.common.result.Result;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 系统访问记录 前端控制器
 * </p>
 *
 * @author FangGL
 * @since 2022-10-29
 */
@Api(tags = "登录日志")
@RestController
@RequestMapping("/admin/sysLoginLog")
@CrossOrigin
public class SysLoginLogController {
    @Autowired
    private SysLoginLogService sysLoginLogService;


    @ApiOperation(value = "获取分页列表")
    @GetMapping("/v1/{page}/{limit}")
    public Result index(
            @ApiParam(name = "page", value = "当前页码", required = true)
            @PathVariable Long page,

            @ApiParam(name = "limit", value = "每页记录数", required = true)
            @PathVariable Long limit,

            @ApiParam(name = "sysLoginLogQueryVo", value = "查询对象", required = false)
                    SysLoginLogQueryVo sysLoginLogQueryVo) {
        IPage<SysLoginLog> pageModel = sysLoginLogService.selectPage(page, limit, sysLoginLogQueryVo);
        return Result.ok(pageModel);
    }




}

